//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package org.come.until;

import java.util.ArrayList;
import java.util.List;

public class SplitStringTool {
	public SplitStringTool() {
	}

	public static List<String> splitString(String allNpcID) {
		List<String> numbers = new ArrayList();
		if (allNpcID != null && !"".equals(allNpcID)) {
			String[] v = allNpcID.split("\\|");

			for(int i = 0; i < v.length; ++i) {
				String[] count;
				if (v[i].indexOf("-") != -1) {
					count = v[i].split("-");
					Integer start = Integer.parseInt(count[0]);
					Integer end = Integer.parseInt(count[1]);

					for(int j = start; j <= end; ++j) {
						numbers.add(String.valueOf(j));
					}
				} else if (v[i].indexOf("&") != -1) {
					count = v[i].split("&");
					int sum = Integer.parseInt(count[1]);

					for(int j = 0; j < sum; ++j) {
						numbers.add(count[0]);
					}
				} else {
					numbers.add(v[i]);
				}
			}

			return numbers;
		} else {
			return numbers;
		}
	}
}
